<template>
  <div>
    <!-- 底部部分 -->
    <footer class="footer">
      <span class="todo-count"
        ><strong>{{ lastsum }}</strong
        >剩余</span
      >
      <ul class="filters">
        <li>
          <a
            :class="{ selected: this.classtype === 'All' }"
            href="#/"
            @click="Changethistype('All')"
            >全部</a
          >
        </li>
        <li>
          <a
            href="#/active"
            :class="{ selected: this.classtype === 'active' }"
            @click="Changethistype('active')"
            >进行中</a
          >
        </li>
        <li>
          <a
            href="#/completed"
            :class="{ selected: this.classtype === 'completed' }"
            @click="Changethistype('completed')"
            >已完成</a
          >
        </li>
      </ul>
      <button class="clear-completed" v-show="clearshow" @click="delAllDone">
        清除已完成
      </button>
    </footer>
  </div>
</template>

<script>
export default {
  name: 'TodoFooter',
  components: {},
  props: {
    lastsum: {
      type: Number,
      required: true,
    },
    clearshow: {
      type: Boolean,
      required: true,
    },
  },
  data() {
    return {
      classtype: 'All',
    }
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    //删除所有
    delAllDone() {
      this.$emit('delAllDone')
    },
    //改变样式
    Changethistype(value) {
      this.classtype = value
      this.$emit('classtype', this.classtype)
    },
  },
}
</script>

<style scoped></style>
